import type { PayloadData } from '@/controller/RefrigeratorB/definition'
import { GetRequest, PostRequest, PutRequest } from '@/utils/request'
import type { Response } from '@/utils/request'
export type VoiceData = {
  data: string[] | VoiceItems
  key: string
  title: string
}
export type VoiceItems = {
  content?: string[]
  title: string
}
//获取产品清单
export function getInventoryList(haId: string) {
  return GetRequest(`/hcaextension/cosmeticFridge/getInventoryList/${haId}`)
}
// 删除产品清单
export function deleteInventoryList(haId: string, data: unknown) {
  return PostRequest(`/hcaextension/cosmeticFridge/deleteInventoryList/${haId}`, {
    payload: data,
  })
}
// 修改产品清单
export function modifyInventoryList(haId: string, id: number, data: unknown) {
  return PostRequest(`/hcaextension/cosmeticFridge/modifyInventoryList/${haId}/${id}`, {
    payload: data,
  })
}
// 添加产品清单
export function insertInventoryList(haId: string, data: unknown) {
  return PostRequest(`/hcaextension/cosmeticFridge/insertInventoryList/${haId}`, {
    payload: data,
  })
}
// 查询产品详情
export function getInventoryDetail(categoryId: string): Promise<Response<PayloadData>> {
  return GetRequest(`/hcaextension/cosmeticFridge/getInventoryDetail/${categoryId}`)
}
// 语音贴士列表
export function getInventoryStatic(): Promise<Response<VoiceData[]>> {
  return GetRequest(`/hcaextension/cosmeticFridge/getInventoryStatic`)
}
